<?php
error_reporting(E_ALL | E_STRICT);
ini_set('display_startup_errors', 1);
ini_set('display_errors', 1);

setlocale(LC_ALL, 'nl_NL.utf8');
date_default_timezone_set('Europe/Amsterdam');

include 'configuration/include.php';

require_once 'Zend/Loader.php';
Zend_Loader::registerAutoload();

Zend_Session::start();

$config = new Zend_Config_Ini('../application/configuration/config.ini');
Zend_Registry::set('config', $config);

include '../application/translations/dutch.php';
$translate = new Zend_Translate('array', $translation, 'nl');
Zend_Registry::set('Zend_Translate', $translate);

$namespace = new Zend_Session_Namespace();
if(isset($namespace->language)) {
	$language = $namespace->language;
} else {
	$language = $config->general->language;
}

Zend_Registry::set('language', $language);

$db = Zend_Db::factory($config->database->connection);
Zend_Db_Table::setDefaultAdapter($db);
Zend_Registry::set('db', $db);

$frontController = Zend_Controller_Front::getInstance();
$frontController->throwExceptions(true);
$frontController->addModuleDirectory($modulePath);

Zend_Controller_Action_HelperBroker::addPath($actionHelperPath);

Zend_Layout::startMvc($config->layout);
Zend_Layout::getMvcInstance()->getView()->setHelperPath($helperPath);

$frontController->dispatch();